import { http } from "@/utils/http";
type Result = {
  current_page: number;
  result?: any;
  per_page?: number;
  total?: number;
  data?: any;
};
type ResultCreate = {
  code: number;
  msg: string;
  result: any;
};
type Show = {
  code: number;
  msg: string;
  result?: any;
};
/** 仓库列表 */
export const getWarehouseListApi = (params?: object) => {
  return http.request<Result>("get", "/dashboard/warehouse/list", {
    params
  });
};
/** 仓库创建 */
export const createWarehouseApi = (data?: object) => {
  return http.request<ResultCreate>("post", "/dashboard/warehouse/store", {
    data
  });
};
/** 仓库修改 */
export const updateWarehouseApi = (data?: object) => {
  return http.request<ResultCreate>("put", "/dashboard/warehouse/update", {
    data
  });
};
/** 仓库删除 */
export const delWarehouseApi = (data?: object) => {
  return http.request<ResultCreate>("delete", "/dashboard/warehouse/delete", {
    data
  });
};
/** 仓库详情 */
export const getWarehouseShowApi = (params?: object) => {
  return http.request<Show>("get", "/dashboard/warehouse/show", {
    params
  });
};
/** 仓库状态修改 */
export const updateWarehouseStatusApi = (data?: object) => {
  return http.request<ResultCreate>("put", "/dashboard/warehouse/updateStatus", {
    data
  });
};
/** 仓库选项 */
export const getWarehouseOptionsApi = (params?: object) => {
  return http.request<Show>("get", "/dashboard/warehouse/options", {
    params
  });
};